#    Copyright 2011, 2012 Tri-County Electric Cooperative, St. Matthews, South Carolina
#    This file is part of COOPWeb.
#    COOPWeb is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#    COOPWeb is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#    You should have received a copy of the GNU General Public License
#    along with COOPWeb.  If not, see <http://www.gnu.org/licenses/>.

#************************BEGIN Add Include Files to Path************************
COOPWebPath='/opt/coopweb/'
LogFileName='/opt/coopweb/log'
import sys, os
NeededPaths=[COOPWebPath + 'djangoproject/include', COOPWebPath + '/djangoproject']
for path in NeededPaths:
    if(not path in sys.path):
        sys.path.append(path)
os.system('export DJANGO_SETTINGS_MODULE=djangoproject.settings')
#************************END   Add Include Files to Path************************

DEBUG=True
import sys
import os
COOPIPServerIPAddress='192.168.100.54'  
COOPWebServerIPAddress='192.168.100.64'  
COOPWebersion=['COOPWeb', '07/27/2011', '0', '0', '0', 'Development']  #Program Name, Date, Release, Major, Minor, Status
COOPWebSRID=2273
COOPWebGPSSRID=4326
COOPWebDistanceMultiplier=1 #Multiplier used for all distance calculations, intended to be Conversion Factor to Convert Feet to Whatever unit used by the SRID
COOPWebSecureWebsiteName='https://employee.tce.coop/coopweb/'

SESSION_COOKIE_SECURE = True
CSRF_COOKIE_SECURE = True

TEMPLATE_DEBUG = DEBUG

ADMINS = ( # ('Your Name', 'your_email@domain.com'),
)			
MANAGERS = ADMINS

DATABASES={}
DATABASES['default']={
'ENGINE': 'django.contrib.gis.db.backends.postgis',           # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'coopweb',                # Or path to database file if using sqlite3.
'USER': 'coopwebdbuser',       # Not used with sqlite3.
'PASSWORD': 'PASSWORD NEEDED',         # Not used with sqlite3.
'HOST': 'localhost',             # Set to empty string for localhost. Not used with sqlite3.
'PORT': '',             # Set to empty string for default. Not used with sqlite3.
}








class COOPWebDatabaseRouter(object):
    def db_for_read(self, model, **hints):
        try:
            using=model.using
        except:
            using='default'
        return using
    def db_for_write(self, model, **hints):
        try:
            using=model.using
        except:
            using='default'
        return using
    def allow_relation(self, obj1, obj2, **hints):
        try:
            using=model.using
        except:
            using='default'
        return using
    def allow_syncdb(self, db, model):
        try:
            using=model.using
        except:
            using='default'
        if(using == 'default' and db == 'default'):
            return True
        else:
            return False

DATABASE_ROUTERS=['djangoproject.settings.COOPWebDatabaseRouter']



# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# although not all choices may be available on all operating systems.
# If running in a Windows environment this must be set to the same as your
# system time zone.
TIME_ZONE = 'America/New_York'

# Language code for this installation. All choices can be found here:
# http://www.i18nguy.com/unicode/language-identifiers.html
LANGUAGE_CODE = 'en-us'

SITE_ID = 1

# If you set this to False, Django will make some optimizations so as not
# to load the internationalization machinery.
USE_I18N = True

# Absolute path to the directory that holds media.
# Example: "/home/media/media.lawrence.com/"
MEDIA_ROOT = '/opt/coopweb/media/'

# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash if there is a path component (optional in other cases).
# Examples: "http://media.lawrence.com", "http://example.com/media/"
MEDIA_URL = ''

# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
# trailing slash.
# Examples: "http://foo.com/media/", "/media/".
ADMIN_MEDIA_PREFIX = '/media/'

# Make this unique, and don't share it with anybody.
SECRET_KEY = '4128nvJHEut43;;[;[392489\'jgewhg84y87yhgnbcx,mbnjskdlgh298ytOIUIHI{{{{{}}{}{}|||||||||Qenjvksdnbxmc,bur47734249851'

# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (
 #   'django.template.loaders.filesystem.load_template_source',
    #'django.template.loaders.app_directories.load_template_source',
    'django.template.loaders.app_directories.Loader',
#     'django.template.loaders.eggs.load_template_source',
)

MIDDLEWARE_CLASSES = (
    'django.middleware.common.CommonMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.middleware.doc.XViewMiddleware',
)

ROOT_URLCONF = 'djangoproject.urls'

TEMPLATE_DIRS = (
    '/opt/coopweb/djangoproject/templates',
       
    # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
    # Always use forward slashes, even on Windows.
    # Don't forget to use absolute paths, not relative paths.
)



INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.admin',
    'django.contrib.gis',
    'djangoproject',
)


AUTHENTICATION_BACKENDS = {
    'django.contrib.auth.backends.ModelBackend',
}



